import { createRouter, createWebHistory } from 'vue-router';
import Home from '@/views/home/home';

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
  },
  {
    path: '/about',
    name: 'About',
    component: () => import('@/views/about'),
  },
  {
    path: '/micro-app-vue3/:page*',
    name: 'MicroAppVue3',
    component: () => import('@/views/micro-apps/micro-app-vue3'),
  },
  {
    path: '/micro-app-vite-vue3/:page*',
    name: 'MicroAppViteVue3',
    component: () => import('@/views/micro-apps/micro-app-vite-vue3'),
  },
  {
    path: '/app-vite/:page*',
    name: 'vite',
    component: () => import('@/views/micro-apps/micro-app-vite-vue3-demo'),
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

// router.beforeEach(() => {
//   console.log('基座路由监听发生变化');
// });

export default router;
